    <?php $this->load->view('user/user_head');?>
    <link href="<?php echo base_url();?>js/thickbox/thickbox.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<?php echo base_url();?>js/thickbox/thickbox.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>js/common.js"></script>
    <script type="text/javascript">
	<!--
	$(function() {
			$(".thickbox").click(function() {
			$('#m_category').val(this.id.split('_')[1]);
			$('#TB_ajaxWindowTitle').text(get_manager_name($('#m_category').val()));
			$.ajax({
				   type: "POST",
				   url: "<?php echo base_url()?>/index.php/user/managerAction/ajax_load",
				   data: {m_category:$('#m_category').val()} ,
				   dataType : "json",
				   cache : false,
				   success: function(json){
					  if (json.have_data) {
						$('#name').val(json.name);
						$('#phone').val(json.phone);
						$('#remark').val(json.remark);
					  } 
				   }
				}); 
			});

			$('#save_button').click(function(){
			    var url = "<?php echo base_url()?>/index.php/user/managerAction/ajax_save";
				var data = {name:$('#name').val(), phone:$('#phone').val(),m_category:$('#m_category').val(), remark:$('#remark').val()};
				$.post(url, data, function(data){
					if (data == "1") {
						tb_remove();
						alert("保存成功");
						location.replace(location); 
					} else {
						alert(data);
		    		}
				})
			});

	});
	
	//-->
	</script>
    <input type="hidden" id="page_code" value="3"/>
    <!-- begin: main content area #main -->
     <div id="main">
      <!-- begin: #col1 - first float column -->
      <div id="col1" role="complementary">
        <?php $this->load->view('user/manager_left_nav.php')?>
      </div>
      <!-- end: #col1 -->
      <!-- begin: #col3 static column -->
      <div id="col3" role="main">
        <div id="col3_content" class="clearfix">
         <div id="ie_clearing">&nbsp;</div>
           
             <div class="my_box" >
           		<p class="box_title"><span>婚礼工作人员安排管理</span></p>
 				<div style="margin:20px;">
	          	      <?php if ($manager_list):?>
	          	      	<table class="datalist" summary="工作人员安排列表" id="oTable">
							<tr>
								<th scope="col" width="15%">姓名</th>
								<th scope="col" width="15%">电话</th>
								<th scope="col" width="20%">类型</th>
								<th scope="col" width="50%">备注</th>
							</tr>
							<?php foreach($manager_list as $v):?>	
							<tr>
								<td>
									<a href="#TB_inline?height=230&width=500&inlineId=manager_form" id="manager_<?php echo $v->m_category?>" title=""  class="thickbox">
										<img title="编辑" alt="编辑" src="<?php echo base_url()?>images/icon/s_edit.png"/> 
										<?php echo $v->name;?>
									</a>
								</td>
								<td><?php echo $v->phone;?></td>
								<td>
									<script>
									document.write(get_manager_name('<?php echo $v->m_category?>'));
									</script>
									
								</td>
								<td><?php echo $v->remark;?></td>
							</tr>
							<?php endforeach;?>
						</table>
	          	      <?php endif;?>
	          	      <?php if (!$manager_list):?>
						婚礼工作人员暂无数据！<a href="<?php echo base_url()?>index.php/user/managerAction/add"> <br /><br />
						<img style="margin: 0 5px 0 5px;"src="<?php echo base_url()?>images/icon/add_s.png" />添加工作人员数据</a>
	          	      <?php endif;?>
 				</div>
            </div>
        </div>
        <div id="ie_clearing">&nbsp;</div>
        <!-- End: IE Column Clearing -->
      </div>
      <!-- end: #col3 -->
    </div>
  	<div id="manager_form" style="display:none">
  		<input type="hidden" name="m_category" id="m_category"/>
 		<p>姓名：<input id="name" name="name" type="text" maxlength="5"/><span style="margin-left:10px;color:#8b8b8b">必须输入姓名；姓名最多输入5个字符</span></p>
 		<p>电话：<input id="phone" name="phone" type="text" maxlength="20"/><span style="margin-left:10px;color:#8b8b8b">电话最多输入25个字符</span></p>
 		<p>备注：<input id="remark" name="remark" type="text" style="width:300px;" maxlength="50"/><span style="margin-left:10px;color:#8b8b8b">备注最多输入50个字符</span></p>
 		<p><button id="save_button" style="padding:5px 10px ;">保存</button></p>
 	</div>
    <!-- end: #main -->
<?php $this->load->view('user/footer');?>